package com.jmb.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

/**
 * 
 * @TableName t_role
 */
@TableName(value ="t_role")
@Data
public class Role extends BaseEntity{

    /**
     * 角色名称
     */
    @Schema(description = "角色名称")
    @NotNull(message = "角色名称不能为空")
    @NotEmpty(message = "角色名称不能为空")
    @Size(max = 20, message = "角色名称长度必须小于等于20")
    @TableField(value = "role_name")
    private String roleName;

    /**
     * 状态0启用1禁用
     */
    @Schema(description = "状态 0启用1禁用")
    @NotNull(message = "状态不能为空")
    @Max(value = 1, message = "状态必须为0~1")
    @Min(value = 0, message = "状态必须为0~1")
    @TableField(value = "status")
    private Integer status;
}